package com.gxl.butt;

import java.io.File;
 
import it.sauronsoftware.jave.AudioAttributes;
import it.sauronsoftware.jave.Encoder;
import it.sauronsoftware.jave.EncoderException;
import it.sauronsoftware.jave.EncodingAttributes;
import it.sauronsoftware.jave.VideoAttributes;
 
public class Snippet {
    public static void main(String[] args) {
		File source = new File("D:\\vedio-test.mp4");
		File target = new File("D:\\new-vedio-test.wmv");
		try {
 
			AudioAttributes audio = new AudioAttributes();
			audio.setCodec("libmp3lame");
			audio.setBitRate(new Integer(56000));
			audio.setChannels(new Integer(1));
			audio.setSamplingRate(new Integer(22050));
			VideoAttributes video = new VideoAttributes();
			video.setCodec("mpeg4");
			video.setBitRate(new Integer(800000));
			video.setFrameRate(new Integer(15));
			EncodingAttributes attrs = new EncodingAttributes();
			attrs.setFormat("wmv");
			attrs.setAudioAttributes(audio);
			attrs.setVideoAttributes(video);
			Encoder encoder = new Encoder();
			encoder.encode(source, target, attrs);
		}
		catch (EncoderException e) {
			e.printStackTrace();
		}
	}
}